package cn.szzsi.common.model;

import cn.szzsi.common.model.base.BaseUserFeedbackReply;

import java.util.Date;

/**
 * 用户反馈
 * Created by yuanzheng on 2016/12/8.
 */
//@TableBind(tableName = "b_user_feedback_reply",pkName = "id")
public class UserFeedbackReply extends BaseUserFeedbackReply<UserFeedbackReply> {
    public static final UserFeedbackReply dao=new UserFeedbackReply().dao();

    public void saveInfo(String content, String feedbackId, String uid, Member member){
        UserFeedbackReply userFeedBackReply=new UserFeedbackReply();
        userFeedBackReply.set("content",content);
        userFeedBackReply.set("fid",feedbackId);
        userFeedBackReply.set("uid",uid);
        userFeedBackReply.set("replier",member.getStr("id"));
        userFeedBackReply.set("createDate",new Date());
        userFeedBackReply.save();
    }

    public UserFeedbackReply getByFeedbackId(Integer feedbackId){
        return UserFeedbackReply.dao.findFirst("select * from mall_user_feedback_reply where fid=?",feedbackId);
    }
}
